package com.yike.product.controller;

import com.yike.common.pagination.Paging;
import com.yike.product.param.SpecificationPageParam;
import com.yike.product.service.SpecificationService;
import com.yike.product.vo.SpecificationVo;
import lombok.extern.slf4j.Slf4j;
import com.yike.common.base.BaseController;
import com.yike.common.api.ApiResult;
import com.yike.common.log.Module;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * 自定义规格 控制器
 *
 * @author yike
 * @since 2024-07-31
 */
@Slf4j
@RestController
@RequestMapping("/specification")
@Module("product")
@Api(value = "自定义规格API", tags = {"自定义规格"})
@ApiIgnore
public class SpecificationController extends BaseController {

    @Autowired
    private SpecificationService specificationService;

    /**
     * 自定义规格分页列表
     */
    @PostMapping("/getCustomPageList")
    //@OperationLog(name = "自定义规格列表分页", type = OperationLogType.PAGE)
    @ApiOperation(value = "自定义规格列表分页", response = SpecificationVo.class)
    public ApiResult<Paging<SpecificationVo>> getSpecificationPageList(@Validated @RequestBody SpecificationPageParam param) throws Exception {
        Paging<SpecificationVo> paging = specificationService.getCustomPageList(param);
        return ApiResult.ok(paging);
    }

}

